#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	char a[100];
	int n;
	gets(a);
	scanf("%d", &n);
	int i, j;
	for (i = 0; a[i] != '\0'; i++)
	{
		if (a[i] >= 'A' && a[i] <= 'Z')
		{
			a[i] = (a[i] - 'A' + n + 26) % 26 + 'A';
		}
		if (a[i] >= 'a' && a[i] <= 'z')
		{
			a[i] = (a[i] - 'a' + n + 26) % 26 + 'a';
		}
	}
	printf("%s", a);
	return 0;
}